package com.dev.mainual.throwable.ssm;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: XXController
 * Description:
 * Date: 2019/1/28 12:48 【需求编号】
 *
 * @author Sam Sho
 * @version V1.0.0
 */
@RestController
public class XXController {

    @Autowired
    private XXService xxService;

    /**
     * 新增方法
     *
     * @param user
     * @return
     * @throws UserIsExistException
     */
    @PostMapping
    public Result add(String user) throws UserIsExistException {

        boolean res = xxService.add(user);
        if (!res) {
            return Result.error();
        }

        return Result.ok();
    }
}
